package com.wkbb.basic.thread;

import com.wkbb.basic.feign.TcCloudFeignService;
import com.wkbb.common.dto.im.GroupUserInfoDto;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author dengjingyuan
 * @date 2019-11-10 11:28
 */
@Slf4j
public class ImSaveGroupUserTask implements Runnable {
    private TcCloudFeignService tcCloudFeignService;

    private List<GroupUserInfoDto> newGroupUserInfoDtoList;

    public ImSaveGroupUserTask(TcCloudFeignService tcCloudFeignService, List<GroupUserInfoDto> newGroupUserInfoDtoList) {
        this.tcCloudFeignService = tcCloudFeignService;
        this.newGroupUserInfoDtoList = newGroupUserInfoDtoList;
    }

    public ImSaveGroupUserTask() {

    }

    @Override
    public void run() {
        log.info("*********ImSaveGroupUserTask********tcCloudFeignService:{},newGroupUserInfoDtoList:{}", tcCloudFeignService, newGroupUserInfoDtoList);
        try {
            tcCloudFeignService.saveAutoTeacher(newGroupUserInfoDtoList);
        } catch (Exception e) {
            log.error("*******ImSaveGroupUserTask**********tcCloudFeignService:{},newGroupUserInfoDtoList:{}", e);
        }
    }
}
